<?php
namespace app\admin\controller;

use app\admin\controller\AdminBaseController;
use think\Cache;
use think\Db;

/**
 * 系统配置
 * Class System
 */
class SystemController extends BaseController {

    /**
     * 站点配置
     */
    public function index() {
    	if ($this->request->isPost()) {
            $site_config   = $this->request->post('site_config/a');
            $data['value'] = serialize($site_config);
            if (Db::name('system')->where('name', 'site_config')->update($data) !== false) {
             
                $this->success('提交成功');
            } else {
                $this->error('提交失败');
            }
        }
    	$site_config=db('system')->field('value')->where('name','site_config')->find();
	    $site_config=unserialize($site_config['value']);  
	    $this->assign('site_config',$site_config);
        return $this->fetch();
        
      
    }


    
	
}
